<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>The MultipleIterator class</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="limititerator.valid.html">« LimitIterator::valid</a></li>
      <li style="float: right;"><a href="multipleiterator.attachiterator.html">MultipleIterator::attachIterator »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="spl.iterators.html">迭代器</a></li>
    <li>The MultipleIterator class</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="class.multipleiterator" class="reference">

 <h1 class="title">The MultipleIterator class</h1>
 

 <div class="partintro"><p class="verinfo">(PHP 5 &gt;= 5.3.0, PHP 7, PHP 8)</p>


  <div class="section" id="multipleiterator.intro">
   <h2 class="title">简介</h2>
   <p class="para">
    An Iterator that sequentially iterates over all attached iterators
   </p>
  </div>


  <div class="section" id="multipleiterator.synopsis">
   <h2 class="title">类摘要</h2>


   <div class="classsynopsis">
    <div class="ooclass">
     
    </div>

    <div class="classsynopsisinfo">
     <span class="ooclass">
      <span class="modifier">class</span> <strong class="classname">MultipleIterator</strong>
     </span>

     <span class="oointerface"><span class="modifier">implements</span> 
       <a href="class.iterator.html" class="interfacename">Iterator</a></span> {</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 常量 */</div>
    <div class="fieldsynopsis">
     <span class="modifier">public</span>
     <span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.multipleiterator.html#multipleiterator.constants.mit-need-any"><var class="varname">MIT_NEED_ANY</var></a></var>;</div>

    <div class="fieldsynopsis"><span class="modifier">public</span>
     <span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.multipleiterator.html#multipleiterator.constants.mit-need-all"><var class="varname">MIT_NEED_ALL</var></a></var>;</div>

    <div class="fieldsynopsis"><span class="modifier">public</span>
     <span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.multipleiterator.html#multipleiterator.constants.mit-keys-numeric"><var class="varname">MIT_KEYS_NUMERIC</var></a></var>;</div>

    <div class="fieldsynopsis"><span class="modifier">public</span>
     <span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.multipleiterator.html#multipleiterator.constants.mit-keys-assoc"><var class="varname">MIT_KEYS_ASSOC</var></a></var>;</div>


    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 方法 */</div>
    <div class="constructorsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><a href="multipleiterator.construct.html" class="methodname">__construct</a></span>(<span class="methodparam"><span class="type">int</span> <code class="parameter">$flags</code><span class="initializer"> = MultipleIterator::MIT_NEED_ALL | MultipleIterator::MIT_KEYS_NUMERIC</span></span>)</div>

    <div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="multipleiterator.attachiterator.html" class="methodname">attachIterator</a></span>(<span class="methodparam"><span class="type"><a href="class.iterator.html" class="type Iterator">Iterator</a></span> <code class="parameter">$iterator</code></span>, <span class="methodparam"><span class="type"><span class="type">string</span>|<span class="type">int</span>|<span class="type">null</span></span> <code class="parameter">$info</code><span class="initializer"> = <strong><code>null</code></strong></span></span>): <span class="type"><span class="type void">void</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="multipleiterator.containsiterator.html" class="methodname">containsIterator</a></span>(<span class="methodparam"><span class="type"><a href="class.iterator.html" class="type Iterator">Iterator</a></span> <code class="parameter">$iterator</code></span>): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="multipleiterator.countiterators.html" class="methodname">countIterators</a></span>(): <span class="type">int</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="multipleiterator.current.html" class="methodname">current</a></span>(): <span class="type">array</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="multipleiterator.detachiterator.html" class="methodname">detachIterator</a></span>(<span class="methodparam"><span class="type"><a href="class.iterator.html" class="type Iterator">Iterator</a></span> <code class="parameter">$iterator</code></span>): <span class="type"><span class="type void">void</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="multipleiterator.getflags.html" class="methodname">getFlags</a></span>(): <span class="type">int</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="multipleiterator.key.html" class="methodname">key</a></span>(): <span class="type">array</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="multipleiterator.next.html" class="methodname">next</a></span>(): <span class="type"><span class="type void">void</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="multipleiterator.rewind.html" class="methodname">rewind</a></span>(): <span class="type"><span class="type void">void</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="multipleiterator.setflags.html" class="methodname">setFlags</a></span>(<span class="methodparam"><span class="type">int</span> <code class="parameter">$flags</code></span>): <span class="type"><span class="type void">void</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="multipleiterator.valid.html" class="methodname">valid</a></span>(): <span class="type">bool</span></div>

   }</div>


  </div>
  

  <div class="section" id="multipleiterator.constants">
   <h2 class="title">预定义常量</h2>
   <dl>

    
     <dt id="multipleiterator.constants.mit-need-any"><strong><code>MultipleIterator::MIT_NEED_ANY</code></strong></dt>

     <dd>

      <p class="para">
       Do not require all sub iterators to be valid in iteration.
      </p>
     </dd>

    

    
     <dt id="multipleiterator.constants.mit-need-all"><strong><code>MultipleIterator::MIT_NEED_ALL</code></strong></dt>

     <dd>

      <p class="para">
       Require all sub iterators to be valid in iteration.
      </p>
     </dd>

    

    
     <dt id="multipleiterator.constants.mit-keys-numeric"><strong><code>MultipleIterator::MIT_KEYS_NUMERIC</code></strong></dt>

     <dd>

      <p class="para">
       Keys are created from the sub iterators position.
      </p>
     </dd>

    

    
     <dt id="multipleiterator.constants.mit-keys-assoc"><strong><code>MultipleIterator::MIT_KEYS_ASSOC</code></strong></dt>

     <dd>

      <p class="para">
       Keys are created from sub iterators associated information.
      </p>
     </dd>

    

   </dl>

  </div>



 </div>

 













































































<h2>目录</h2><ul class="chunklist chunklist_reference"><li><a href="multipleiterator.attachiterator.html">MultipleIterator::attachIterator</a> — Attaches iterator information</li><li><a href="multipleiterator.construct.html">MultipleIterator::__construct</a> — Constructs a new MultipleIterator</li><li><a href="multipleiterator.containsiterator.html">MultipleIterator::containsIterator</a> — Checks if an iterator is attached</li><li><a href="multipleiterator.countiterators.html">MultipleIterator::countIterators</a> — Gets the number of attached iterator instances</li><li><a href="multipleiterator.current.html">MultipleIterator::current</a> — Gets the registered iterator instances</li><li><a href="multipleiterator.detachiterator.html">MultipleIterator::detachIterator</a> — Detaches an iterator</li><li><a href="multipleiterator.getflags.html">MultipleIterator::getFlags</a> — Gets the flag information</li><li><a href="multipleiterator.key.html">MultipleIterator::key</a> — Gets the registered iterator instances</li><li><a href="multipleiterator.next.html">MultipleIterator::next</a> — Moves all attached iterator instances forward</li><li><a href="multipleiterator.rewind.html">MultipleIterator::rewind</a> — Rewinds all attached iterator instances</li><li><a href="multipleiterator.setflags.html">MultipleIterator::setFlags</a> — Sets flags</li><li><a href="multipleiterator.valid.html">MultipleIterator::valid</a> — Checks the validity of sub iterators</li></ul>
</div>
</div></div></body></html>